﻿@model S4Store.Models.Markting.WZXJBHistoryModel
@{
    Layout = null;
    ViewBag.Title = "WZXJBHistory";

    List<S4Store.Models.Chart.Line> models = new List<S4Store.Models.Chart.Line>();
    foreach(var m in Model.Medias){
        S4Store.Models.Chart.Line ChartModel1 = new S4Store.Models.Chart.Line();
        ChartModel1.Name = m.Name+"集客效果KPI";
        ChartModel1.YAxis = "比率(%)";
    
        S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "资金投入比";
        S4Store.Models.Chart.ChartSeries series2= new S4Store.Models.Chart.ChartSeries();
        series2.Name = "信息获取比";
        ChartModel1.Serieses.Add(series1);
        ChartModel1.Serieses.Add(series2);
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel1.XAxis.Add(dt.ToString("M月"));
            var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month&&t.Media.Id==m.Id);
            series1.Data.Add(report.ZJTRB);
            series2.Data.Add(report.HQXXB);
        }
        models.Add(ChartModel1);
    }
}
<div style="height:100%; width:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div class="pageContent">
	
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
                    @foreach(var m in Model.Medias){
                        <li><a href="javascript:;"><span>@(m.Name)性价对比</span></a></li>
                    }					
				</ul>
			</div>
		</div>
		<div class="tabsContent" >
            @foreach (var line in models)
            {
			<div>
            @Html.Partial("../Chart/Line", line)
			</div>
            }
		</div>
		<div class="tabsFooter">
			<div class="tabsFooterContent"></div>
		</div>
	</div>
</div>

</div>
